package cn.chrisn;

import java.util.function.IntBinaryOperator;

/**
 * @Description
 * @Author Chrisn
 * @Date 2025/4/26
 */
public class mathTest {

    public static void main(String[] args) {
        /*
        int i = calculateNum(new IntBinaryOperator() {
            @Override
            public int applyAsInt(int left, int right) {
                return left + right;
            }
        });
         */
        int i = calculateNum(( left,  right) -> left+right);

//        int i = calculateNum((int left, int right) -> {
//            return left+right;});
        System.out.println(i);
    }
    public static int calculateNum(IntBinaryOperator operator){
        int a=10;
        int b=20;
        return operator.applyAsInt(a,b);
    }
}
